﻿using System.Windows.Controls;
using System.Windows.Media;

namespace YourControl.ViewPicture.UserControls
{
    public partial class PictureBoxControl
    {
        public PictureBoxControl():this(null)
        {
            InitializeComponent();
        }

        public PictureBoxControl(ImageSource imageSource)
        {
            if (null != imageSource)
            {
                Source = imageSource;
            }
        }

        private ImageSource _imageSource;
        public ImageSource Source
        {
            get { return _imageSource; }
            set 
            { 
                _imageSource = value;
                image.Source = _imageSource;
                image.Stretch = Stretch.UniformToFill;
                image.Width = 320;
                image.Height = 460;
            }
            
        }
    }
}
